<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from './components/HelloWorld.vue'
import { useStore } from 'vuex'
import { computed } from 'vue'

const store = useStore()
const count = computed(() => store.state.user.count)
const add = () => {
   store.commit("user/add");
}
</script>

<template>
  <img alt="Vue logo" src="@/assets/logo.png" />

  <HelloWorld msg="Hello Vue 3 + TypeScript + Vite + Router + Vuex" />

  <div style="height: 10px;">{{count}}</div>

  <button type="button" @click="add">count is: {{ count }}</button>

  <div>
    路由跳转
    <router-link to="/">Go to Home</router-link> |
    <router-link to="/about">Go to About</router-link>
    <router-view></router-view>
  </div>
</template>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
